package com.mmall.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.mmall.pojo.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface CartMapper extends BaseMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    Cart selectCartByUserIdProductId(@Param("userId") Integer userId,@Param("productId") Integer productId);

    List<Cart> selectCartByUserId(Integer userId);

    int selectCartProductCheckedStatusByUserId (Integer userId);

    int deletByUserIdProductIds(@Param("userId") Integer userId,@Param("productIdList") List productIdList);

    int checkedOrUnCheckedProduct(@Param("userId")Integer userId,@Param("checked")Integer checked);

    int getCartProductCount(Integer userId);

    List<Cart> selectCheckedCarByUserId(Integer userId);
}